package com.seari.service.impl;

import com.seari.bean.DevLifeBean;
import com.seari.mapper.DevLifeMapper;
import com.seari.pojo.DevLifeCirclePojo;
import com.seari.pojo.DevPojo;
import com.seari.pojo.StationPojo;
import com.seari.service.DevLifeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DevLifeServiceImpl implements DevLifeService {

    @Autowired
    private DevLifeMapper devLifeMapper;

    /**
     * 查询资材列表
     * @return
     */
    @Override
    public List<DevPojo> findDevList() {
        return devLifeMapper.findDevList();
    }

    /**
     * 查询资材生命周期
     * @param productId
     * @return
     */
    @Override
    public List<DevLifeCirclePojo> findDevLifeCircleList(String productId) {
        return devLifeMapper.findDevLifeCircleList(productId);
    }

    /**
     * 查询站台
     * @return
     */
    @Override
    public List<StationPojo> findStationList() {
        return devLifeMapper.findStationList();
    }

    /**
     * 根据专业，系统，类型和关键字查询
     * @param mcList
     * @param keyWords
     * @return
     */
    @Override
    public List<DevPojo> findDevList(String[] mcList, String keyWords,String stationId,int start ,int limit) {
        return devLifeMapper.findDevList2(mcList,keyWords,stationId,start,limit);
    }

    @Override
    public void saveDevLifeInfo(DevLifeBean devLife) {
        devLifeMapper.saveDevLifeInfo(devLife);
    }

    @Override
    public int batchSaveDevLife(List<DevLifeBean> devLifeBeanList) {
        return devLifeMapper.batchSaveDevLife(devLifeBeanList);
    }

    @Override
    public int deleteDevLifeCircleById(DevLifeBean devLife) {
        return devLifeMapper.deleteDevLifeCircleById(devLife);
    }
}
